FROM node:13.8-alpine

LABEL maintainer="cwl<chenwenlong@epweike.com>"

# repositorie mirror、timezone、git、openssh
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/' /etc/apk/repositories ; \
    apk add --no-cache --virtual .semantic-deps tzdata git openssh curl jq; \
    ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime ; \
    echo 'Asia/Shanghai' > /etc/timezone; \
    rm -rf /var/cache/apk/* /tmp/* /var/tmp/* /var/lib/apt/lists/*

RUN npm config set registry https://registry.npm.taobao.org; \
    npm install -g \
    marked@^0.4.0 marked-terminal \
    semantic-release@16 \
    @semantic-release/commit-analyzer \
    @semantic-release/git \
    @semantic-release/changelog \
    @semantic-release/release-notes-generator \
    @semantic-release/exec; \
    npm cache clean --force

ENTRYPOINT [ "semantic-release" ]
